<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdrawutil.cpp -->
  <title>&lt;qdrawutil.h&gt; - Drawing Utility Functions | Qt Widgets 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td >&lt;qdrawutil.h&gt; - Drawing Utility Functions</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">&lt;qdrawutil.h&gt; - Drawing Utility Functions</h1>
<span class="subtitle"></span>
<ul>
</ul>
<a name="Functions"></a>
<h2 id="Functions">Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawBorderPixmap">qDrawBorderPixmap</a></b>(QPainter *<i>painter</i>, const QRect &amp;<i>target</i>, const QMargins &amp;<i>margins</i>, const QPixmap &amp;<i>pixmap</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawPlainRect">qDrawPlainRect</a></b>(QPainter *<i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QColor &amp;<i>lineColor</i>, int <i>lineWidth</i> = 1, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawPlainRect-1">qDrawPlainRect</a></b>(QPainter *<i>painter</i>, const QRect &amp;<i>rect</i>, const QColor &amp;<i>lineColor</i>, int <i>lineWidth</i> = 1, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a></b>(QPainter *<i>painter</i>, int <i>x1</i>, int <i>y1</i>, int <i>x2</i>, int <i>y2</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = true, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeLine-1">qDrawShadeLine</a></b>(QPainter *<i>painter</i>, const QPoint &amp;<i>p1</i>, const QPoint &amp;<i>p2</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = true, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a></b>(QPainter *<i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadePanel-1">qDrawShadePanel</a></b>(QPainter *<i>painter</i>, const QRect &amp;<i>rect</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a></b>(QPainter *<i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeRect-1">qDrawShadeRect</a></b>(QPainter *<i>painter</i>, const QRect &amp;<i>rect</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawWinButton">qDrawWinButton</a></b>(QPainter *<i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawWinButton-1">qDrawWinButton</a></b>(QPainter *<i>painter</i>, const QRect &amp;<i>rect</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, const QBrush *<i>fill</i> = nullptr)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a></b>(QPainter *<i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette &amp;<i>palette</i>, bool <i>sunken</i> = false, const QBrush *<i>fill</i> = nullptr)</td></tr>
</table></div>
<!-- $$$<qdrawutil.h>-description -->
<div class="descr"> <a name="details"></a>
</div>
<p><b>请参考 </b><a href="../qtgui/qpainter.html">QPainter</a>。</p>
<!-- @@@<qdrawutil.h> -->
<h2>Function Documentation</h2>
<!-- $$$qDrawBorderPixmap[overload1]$$$qDrawBorderPixmapQPainter*constQRect&constQMargins&constQPixmap& -->
<h3 class="fn" id="qDrawBorderPixmap"><a name="qDrawBorderPixmap"></a><span class="type">void</span> <span class="name">qDrawBorderPixmap</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>target</i>, const <span class="type"><a href="../qtcore/qmargins.html">QMargins</a></span> &amp;<i>margins</i>, const <span class="type"><a href="../qtgui/qpixmap.html">QPixmap</a></span> &amp;<i>pixmap</i>)</h3>
<p>The qDrawBorderPixmap function is for drawing a pixmap into the margins of a rectangle.</p>
<p>Draws the given <i>pixmap</i> into the given <i>target</i> rectangle, using the given <i>painter</i>. The pixmap will be split into nine segments and drawn according to the <i>margins</i> structure.</p>
<p>该函数于Qt 4.6中引入。</p>
<!-- @@@qDrawBorderPixmap -->
<!-- $$$qDrawPlainRect[overload1]$$$qDrawPlainRectQPainter*intintintintconstQColor&intconstQBrush* -->
<h3 class="fn" id="qDrawPlainRect"><a name="qDrawPlainRect"></a><span class="type">void</span> <span class="name">qDrawPlainRect</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &amp;<i>lineColor</i>, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>Draws the plain rectangle beginning at (<i>x</i>, <i>y</i>) with the given <i>width</i> and <i>height</i>, using the specified <i>painter</i>, <i>lineColor</i> and <i>lineWidth</i>. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a plain rectangle:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Plain);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>() 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawPlainRect -->
<!-- $$$qDrawPlainRect$$$qDrawPlainRectQPainter*constQRect&constQColor&intconstQBrush* -->
<h3 class="fn" id="qDrawPlainRect-1"><a name="qDrawPlainRect-1"></a><span class="type">void</span> <span class="name">qDrawPlainRect</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>, const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &amp;<i>lineColor</i>, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>这是一个重载函数。</p>
<p>Draws the plain rectangle specified by <i>rect</i> using the given <i>painter</i>, <i>lineColor</i> and <i>lineWidth</i>. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a plain rectangle:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Plain);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>() 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawPlainRect -->
<!-- $$$qDrawShadeLine[overload1]$$$qDrawShadeLineQPainter*intintintintconstQPalette&boolintint -->
<h3 class="fn" id="qDrawShadeLine"><a name="qDrawShadeLine"></a><span class="type">void</span> <span class="name">qDrawShadeLine</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, <span class="type">int</span> <i>x1</i>, <span class="type">int</span> <i>y1</i>, <span class="type">int</span> <i>x2</i>, <span class="type">int</span> <i>y2</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = true, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0)</h3>
<p>Draws a horizontal (<i>y1</i> == <i>y2</i>) or vertical (<i>x1</i> == <i>x2</i>) shaded line using the given <i>painter</i>. Note that nothing is drawn if <i>y1</i> != <i>y2</i> and <i>x1</i> != <i>x2</i> (i.e&#x2e; the line is neither horizontal nor vertical).</p>
<p>The provided <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors). The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The given <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="../qtgui/qpalette.html#mid">QPalette::mid</a>() color.</p>
<p>The line appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded line:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>HLine <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawShadeLine -->
<!-- $$$qDrawShadeLine$$$qDrawShadeLineQPainter*constQPoint&constQPoint&constQPalette&boolintint -->
<h3 class="fn" id="qDrawShadeLine-1"><a name="qDrawShadeLine-1"></a><span class="type">void</span> <span class="name">qDrawShadeLine</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>p1</i>, const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>p2</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = true, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0)</h3>
<p>这是一个重载函数。</p>
<p>Draws a horizontal or vertical shaded line between <i>p1</i> and <i>p2</i> using the given <i>painter</i>. Note that nothing is drawn if the line between the points would be neither horizontal nor vertical.</p>
<p>The provided <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors). The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The given <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="../qtgui/qpalette.html#mid">QPalette::mid</a>() color.</p>
<p>The line appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded line:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>HLine <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawShadeLine -->
<!-- $$$qDrawShadePanel[overload1]$$$qDrawShadePanelQPainter*intintintintconstQPalette&boolintconstQBrush* -->
<h3 class="fn" id="qDrawShadePanel"><a name="qDrawShadePanel"></a><span class="type">void</span> <span class="name">qDrawShadePanel</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>Draws the shaded panel beginning at (<i>x</i>, <i>y</i>) with the given <i>width</i> and <i>height</i> using the provided <i>painter</i> and the given <i>lineWidth</i>.</p>
<p>The given <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors). The panel's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The panel appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded panel:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle( <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Panel <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>(), <a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawShadePanel -->
<!-- $$$qDrawShadePanel$$$qDrawShadePanelQPainter*constQRect&constQPalette&boolintconstQBrush* -->
<h3 class="fn" id="qDrawShadePanel-1"><a name="qDrawShadePanel-1"></a><span class="type">void</span> <span class="name">qDrawShadePanel</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>这是一个重载函数。</p>
<p>Draws the shaded panel at the rectangle specified by <i>rect</i> using the given <i>painter</i> and the given <i>lineWidth</i>.</p>
<p>The given <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors). The panel's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The panel appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded panel:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle( <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Panel <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>(), <a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawShadePanel -->
<!-- $$$qDrawShadeRect[overload1]$$$qDrawShadeRectQPainter*intintintintconstQPalette&boolintintconstQBrush* -->
<h3 class="fn" id="qDrawShadeRect"><a name="qDrawShadeRect"></a><span class="type">void</span> <span class="name">qDrawShadeRect</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>Draws the shaded rectangle beginning at (<i>x</i>, <i>y</i>) with the given <i>width</i> and <i>height</i> using the provided <i>painter</i>.</p>
<p>The provide <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors. The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="../qtgui/qpalette.html#mid">QPalette::mid</a>() color. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The rectangle appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded rectangle:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Raised);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), <a href="qdrawutil-h.html#qDrawPlainRect">qDrawPlainRect</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawShadeRect -->
<!-- $$$qDrawShadeRect$$$qDrawShadeRectQPainter*constQRect&constQPalette&boolintintconstQBrush* -->
<h3 class="fn" id="qDrawShadeRect-1"><a name="qDrawShadeRect-1"></a><span class="type">void</span> <span class="name">qDrawShadeRect</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>这是一个重载函数。</p>
<p>Draws the shaded rectangle specified by <i>rect</i> using the given <i>painter</i>.</p>
<p>The provide <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors. The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="../qtgui/qpalette.html#mid">QPalette::mid</a>() color. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The rectangle appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded rectangle:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Raised);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), <a href="qdrawutil-h.html#qDrawPlainRect">qDrawPlainRect</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawShadeRect -->
<!-- $$$qDrawWinButton[overload1]$$$qDrawWinButtonQPainter*intintintintconstQPalette&boolconstQBrush* -->
<h3 class="fn" id="qDrawWinButton"><a name="qDrawWinButton"></a><span class="type">void</span> <span class="name">qDrawWinButton</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>Draws the Windows-style button specified by the given point (<i>x</i>, <i>y</i>}, <i>width</i> and <i>height</i> using the provided <i>painter</i> with a line width of 2 pixels. The button's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The given <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors).</p>
<p>The button appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>()-&gt; Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>() 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawWinButton -->
<!-- $$$qDrawWinButton$$$qDrawWinButtonQPainter*constQRect&constQPalette&boolconstQBrush* -->
<h3 class="fn" id="qDrawWinButton-1"><a name="qDrawWinButton-1"></a><span class="type">void</span> <span class="name">qDrawWinButton</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>这是一个重载函数。</p>
<p>Draws the Windows-style button at the rectangle specified by <i>rect</i> using the given <i>painter</i> with a line width of 2 pixels. The button's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The given <i>palette</i> specifies the shading colors (<a href="../qtgui/qpalette.html#light">light</a>, <a href="../qtgui/qpalette.html#dark">dark</a> and <a href="../qtgui/qpalette.html#mid">middle</a> colors).</p>
<p>The button appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>()-&gt; Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>() 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawWinButton -->
<!-- $$$qDrawWinPanel[overload1]$$$qDrawWinPanelQPainter*intintintintconstQPalette&boolconstQBrush* -->
<h3 class="fn" id="qDrawWinPanel"><a name="qDrawWinPanel"></a><span class="type">void</span> <span class="name">qDrawWinPanel</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span> &amp;<i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> *<i>fill</i> = nullptr)</h3>
<p>Draws the Windows-style panel specified by the given point(<i>x</i>, <i>y</i>), <i>width</i> and <i>height</i> using the provided <i>painter</i> with a line width of 2 pixels. The button's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p>
<p>The given <i>palette</i> specifies the shading colors. The panel appears sunken if <i>sunken</i> is true, otherwise raised.</p>
<p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p>
<p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded panel:</p>
<pre class="cpp">

  <span class="type"><a href="qframe.html">QFrame</a></span> frame:
  frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>WinPanel <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Raised);

</pre>
<p><b>请参考 </b><a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), <a href="qdrawutil-h.html#qDrawWinButton">qDrawWinButton</a>(), 和 <a href="qstyle.html">QStyle</a>。</p>
<!-- @@@qDrawWinPanel -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
